package com.nzd.slsharing.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 生活分享实体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("life_sharing")
public class LifeSharing {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String name;
    private String content;
    private String author;
    private Integer numberLikes;
    private String postImage;
    private Integer status;
    private Integer type;
    // 数据库timestamp类型时间转化java规定格式时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    // 接受前端表单传递过来的字符串类型的时间数
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    // 数据库timestamp类型时间转化java规定格式时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    // 接受前端表单传递过来的字符串类型的时间数
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
